import React from 'react'
import { withRouter, NavLink } from 'react-router-dom'
import { observer, inject } from 'mobx-react'
@withRouter
@inject('kao')
@observer
class App extends React.Component {
    constructor() {
        super()
    }
    setName = ({ target }) => {
        let value = target.value
        this.props.kao.setName(value)
    }
    setbanji = ({ target }) => {
        let value = target.value
        this.props.kao.setbanji(value)
    }
    setText = ({ target }) => {
        let value = target.value
        this.props.kao.setText(value)
    }
    render() {
        const { name, banji, text ,setNum} = this.props.kao
        return (
            <div className='okkao'>
                <p>二、开始考试</p>
                <div>
                    <span>姓名</span><input type="text" value={name} onChange={(e) => this.setName(e)} />
                </div>
                <div>
                    <span>班级</span><input type="text" value={banji} onChange={(e) => this.setbanji(e)} />
                </div>
                <div>
                    <span>考试内容</span><input type="text" value={text} onChange={(e) => this.setText(e)} />
                </div>
                <button onClick={()=>setNum(3)}>准备上机</button>
            </div>
        )
    }
}
export default App